package com.dal.db.dao;

import com.sojoys.artifact.manager.DataSourceManager;
import java.sql.Connection;
import com.dal.db.bean.Account;
import com.sojoys.artifact.build.data.base.BaseDao;
import java.util.ArrayList;
import com.sojoys.artifact.manager.JsonManager;
import java.sql.SQLException;
import com.google.common.collect.Lists;
import org.apache.commons.dbutils.handlers.MapHandler;
import com.sojoys.artifact.tools.SK_Plus;
import java.sql.ResultSet;
import java.util.Map;
import javax.sql.DataSource;
import org.apache.commons.dbutils.handlers.MapListHandler;
import com.sojoys.artifact.constant.CreateTableEnum;
import com.sojoys.artifact.constant.DataModelKeyEnum;
import org.apache.commons.dbutils.handlers.AbstractListHandler;
import org.apache.commons.dbutils.QueryRunner;
import com.xiaoleilu.hutool.log.Log;
import java.util.Set;
import com.sojoys.artifact.constant.ArtifactErrorCode;
import static com.dal.db.StaticResource.AccountResource.*;
import com.xiaoleilu.hutool.util.StrUtil;
import com.sojoys.artifact.tools.ToolError;
import org.apache.commons.dbutils.DbUtils;
import com.xiaoleilu.hutool.log.LogFactory;
import java.util.List;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.dbutils.ResultSetHandler;
import com.google.common.base.Joiner;
import static com.dal.db.StaticResource.AccountResource.*;
/**
 * 账号表
 */
@SuppressWarnings({ "rawtypes", "unchecked" })
public class AccountDaoImpl implements BaseDao<String,Account>{
	static Log log = LogFactory.get(AccountDaoImpl.class);
	
	// 代理
	
	/**
	 * 私有化无参构造方法
	 */
	private AccountDaoImpl() {}
	  
    private static final AccountDaoImpl INSTANCE = new AccountDaoImpl();  
    
    public static AccountDaoImpl me() {  
        return INSTANCE;  
    }  
	
	public Account insert(Account account){
		Connection conn = DataSourceManager.me().getMainConnection();
		return insert(account,conn);
	}
	
	public Account insert(Account account,Connection conn){
		return insert(account,conn,TABLE_NAME);
	}
	
	public Account insert(Account account,DataSource ds){
		try {
			Connection conn = ds.getConnection();
			return insert(account,conn);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	
	public Account insert(Account account,String tableName){
		Connection conn = DataSourceManager.me().getMainConnection();
		return insert(account,conn,tableName);
	}
	
	public Account insert(Account account,Connection conn,String tableName){
		
		QueryRunner run = new QueryRunner();
		String sql = "INSERT INTO " +tableName+ " (id,account_id,channel_id,channel_app_id,password,email,device_token,device_name,device_id,sdk,sdk_version,os_name,os_version,phone_number,client_version,question,answer,admin,game_server_id,language,ip,last_online_time,last_offline_time,state,online_state,activate,create_date,modified_date) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
		try {
			int i = run.update(conn,sql,account.getId(),account.getAccountId(),account.getChannelId(),account.getChannelAppId(),account.getPassword(),account.getEmail(),account.getDeviceToken(),account.getDeviceName(),account.getDeviceId(),account.getSdk(),account.getSdkVersion(),account.getOsName(),account.getOsVersion(),account.getPhoneNumber(),account.getClientVersion(),account.getQuestion(),account.getAnswer(),account.isAdmin(),account.getGameServerId(),account.getLanguage(),account.getIp(),account.getLastOnlineTime(),account.getLastOfflineTime(),account.getState(),account.getOnlineState(),account.isActivate(),account.getCreateDate(),account.getModifiedDate());
			return i > 0 ? account : null;
		} catch (Exception e) {
			log.error(e);
			return null;
		} finally {
			try{
				DbUtils.close(conn);
			}catch (Exception e1) {
				log.error(e1);
				return null;
			}
		}
	}
	
	public Account insert(Account account,DataSource ds,String tableName){
		try {
			Connection conn = ds.getConnection();
			return insert(account,conn,tableName);
		} catch (Exception e) {
			log.error(e);
			return null;
		}		
	}
	
	public int[] insertBatch(List<Account> accounts){
		Connection conn = DataSourceManager.me().getMainConnection();
		return insertBatch(accounts,conn);
	}
	
	public int[] insertBatch(List<Account> accounts,Connection conn){
		return insertBatch(accounts,conn,TABLE_NAME);
	}
	
	public int[] insertBatch(List<Account> accounts,DataSource ds){
		try {
			Connection conn = ds.getConnection();
			return insertBatch(accounts,conn);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	
	public int[] insertBatch(List<Account> accounts,String tableName){
		Connection conn = DataSourceManager.me().getMainConnection();
		return insertBatch(accounts,conn,tableName);
	}
	
	public int[] insertBatch(List<Account> accounts,Connection conn,String tableName){
		QueryRunner run = new QueryRunner();
		String sql = "INSERT INTO " +tableName+ " (id,account_id,channel_id,channel_app_id,password,email,device_token,device_name,device_id,sdk,sdk_version,os_name,os_version,phone_number,client_version,question,answer,admin,game_server_id,language,ip,last_online_time,last_offline_time,state,online_state,activate,create_date,modified_date) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
		try {
			int columnSize = 28;
			int size = accounts.size();
			Object[][] params = new Object[size][columnSize];
			for (int i = 0; i < size; i++) {
				params[i][0] =accounts.get(i).getId();
				params[i][1] =accounts.get(i).getAccountId();
				params[i][2] =accounts.get(i).getChannelId();
				params[i][3] =accounts.get(i).getChannelAppId();
				params[i][4] =accounts.get(i).getPassword();
				params[i][5] =accounts.get(i).getEmail();
				params[i][6] =accounts.get(i).getDeviceToken();
				params[i][7] =accounts.get(i).getDeviceName();
				params[i][8] =accounts.get(i).getDeviceId();
				params[i][9] =accounts.get(i).getSdk();
				params[i][10] =accounts.get(i).getSdkVersion();
				params[i][11] =accounts.get(i).getOsName();
				params[i][12] =accounts.get(i).getOsVersion();
				params[i][13] =accounts.get(i).getPhoneNumber();
				params[i][14] =accounts.get(i).getClientVersion();
				params[i][15] =accounts.get(i).getQuestion();
				params[i][16] =accounts.get(i).getAnswer();
				params[i][17] =accounts.get(i).isAdmin();
				params[i][18] =accounts.get(i).getGameServerId();
				params[i][19] =accounts.get(i).getLanguage();
				params[i][20] =accounts.get(i).getIp();
				params[i][21] =accounts.get(i).getLastOnlineTime();
				params[i][22] =accounts.get(i).getLastOfflineTime();
				params[i][23] =accounts.get(i).getState();
				params[i][24] =accounts.get(i).getOnlineState();
				params[i][25] =accounts.get(i).isActivate();
				params[i][26] =accounts.get(i).getCreateDate();
				params[i][27] =accounts.get(i).getModifiedDate();
			}
			int[] is = run.batch(conn,sql,params);
			return is.length > 0 ? is : new int[]{};
		} catch (Exception e) {
			log.error(e);
			return new int[]{};
		} finally {
			try{
				DbUtils.close(conn);
			}catch (Exception e1) {
				log.error(e1);
				return null;
			}
		}
	}
	
	public int[] insertBatch(List<Account> accounts,DataSource ds,String tableName){
		try {
			Connection conn = ds.getConnection();
			return insertBatch(accounts,conn,tableName);
		} catch (Exception e) {
			log.error(e);
			return null;
		}		
	}
	
	public Account update(Account account){
		Connection conn = DataSourceManager.me().getMainConnection();
		return update(account,conn);
	}
	
	public Account update(Account account,Connection conn){
		return update(account,conn,TABLE_NAME);
	}
	
	public Account update(Account account,DataSource ds){
		try {
			Connection conn = ds.getConnection();
			return update(account,conn);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	
	public Account update(Account account,String tableName){
		Connection conn = DataSourceManager.me().getMainConnection();
		return update(account,conn,tableName);
	}
	
	public Account update(Account account,Connection conn,String tableName){
		List<Account> accounts = new ArrayList<Account>();
		accounts.add(account);
		updateBatch(accounts,conn,tableName);
		return account;
	}
	
	public Account update(Account account,DataSource ds,String tableName){
		try {
			Connection conn = ds.getConnection();
			return update(account,conn,tableName);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	
	public int[] updateBatch(List<Account> accounts){
		Connection conn = DataSourceManager.me().getMainConnection();
		return updateBatch(accounts,conn);
	}
	
	public int[] updateBatch(List<Account> accounts,Connection conn){
		return updateBatch(accounts,conn,TABLE_NAME);
	}
	
	public int[] updateBatch(List<Account> accounts,DataSource ds){
		try {
			Connection conn = ds.getConnection();
			return updateBatch(accounts,conn);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	
	public int[] updateBatch(List<Account> accounts,String tableName){
		Connection conn = DataSourceManager.me().getMainConnection();
		return updateBatch(accounts,conn,tableName);
	}
	
	public int[] updateBatch(List<Account> accounts,Connection conn,String tableName){
		QueryRunner run = new QueryRunner();
		String sql = "UPDATE " +tableName+ " SET id = ?,account_id = ?,channel_id = ?,channel_app_id = ?,password = ?,email = ?,device_token = ?,device_name = ?,device_id = ?,sdk = ?,sdk_version = ?,os_name = ?,os_version = ?,phone_number = ?,client_version = ?,question = ?,answer = ?,admin = ?,game_server_id = ?,language = ?,ip = ?,last_online_time = ?,last_offline_time = ?,state = ?,online_state = ?,activate = ?,create_date = ?,modified_date = ? WHERE id = ?";
		try {
			int columnSize = 28;
			int size = accounts.size();
			Object[][] params = new Object[size][columnSize + 1];
			for (int i = 0; i < size; i++) {
				params[i][0] =accounts.get(i).getId();
				params[i][1] =accounts.get(i).getAccountId();
				params[i][2] =accounts.get(i).getChannelId();
				params[i][3] =accounts.get(i).getChannelAppId();
				params[i][4] =accounts.get(i).getPassword();
				params[i][5] =accounts.get(i).getEmail();
				params[i][6] =accounts.get(i).getDeviceToken();
				params[i][7] =accounts.get(i).getDeviceName();
				params[i][8] =accounts.get(i).getDeviceId();
				params[i][9] =accounts.get(i).getSdk();
				params[i][10] =accounts.get(i).getSdkVersion();
				params[i][11] =accounts.get(i).getOsName();
				params[i][12] =accounts.get(i).getOsVersion();
				params[i][13] =accounts.get(i).getPhoneNumber();
				params[i][14] =accounts.get(i).getClientVersion();
				params[i][15] =accounts.get(i).getQuestion();
				params[i][16] =accounts.get(i).getAnswer();
				params[i][17] =accounts.get(i).isAdmin();
				params[i][18] =accounts.get(i).getGameServerId();
				params[i][19] =accounts.get(i).getLanguage();
				params[i][20] =accounts.get(i).getIp();
				params[i][21] =accounts.get(i).getLastOnlineTime();
				params[i][22] =accounts.get(i).getLastOfflineTime();
				params[i][23] =accounts.get(i).getState();
				params[i][24] =accounts.get(i).getOnlineState();
				params[i][25] =accounts.get(i).isActivate();
				params[i][26] =accounts.get(i).getCreateDate();
				params[i][27] =accounts.get(i).getModifiedDate();
				params[i][columnSize] =accounts.get(i).getId();
			}
			int[] is = run.batch(conn,sql,params);
			return is.length > 0 ? is : new int[]{};
		} catch (Exception e) {
			log.error(e);
			return new int[]{};
		} finally {
			try{
				DbUtils.close(conn);
			}catch (Exception e1) {
				log.error(e1);
				return null;
			}
		}
	}
	
	public int[] updateBatch(List<Account> accounts,DataSource ds,String tableName){
		try {
			Connection conn = ds.getConnection();
			return updateBatch(accounts,conn,tableName);
		} catch (Exception e) {
			log.error(e);
			return null;
		}		
	}
	
	public boolean delete(Account account){
		Connection conn = DataSourceManager.me().getMainConnection();
		return delete(account,conn);
	}
	
	public boolean delete(Account account,Connection conn){
		return delete(account,conn,TABLE_NAME);
	}
	
	public boolean delete(Account account,DataSource ds){
		try {
			Connection conn = ds.getConnection();
			return delete(account,conn);
		} catch (Exception e) {
			log.error(e);
			return false;
		}
	}
	
	public boolean delete(Account account,String tableName){
		Connection conn = DataSourceManager.me().getMainConnection();
		return delete(account,conn,tableName);
	}
	
	public boolean delete(Account account,Connection conn,String tableName){
		QueryRunner run = new QueryRunner();
		String sql = "DELETE FROM " + tableName + " WHERE id = ?";
		try {
			int i = run.update(conn,sql, account.getId());
			return i > 0 ? true : false;
		} catch (Exception e) {
			log.error(e);
			return false;
		}finally {
			try{
				DbUtils.close(conn);
			}catch (Exception e1) {
				log.error(e1);
				return false;
			}
		}
	}
	
	public boolean delete(Account account,DataSource ds,String tableName){
		try {
			Connection conn = ds.getConnection();
			return delete(account,conn,tableName);
		} catch (Exception e) {
			log.error(e);
			return false;
		}
	}
	
	
	public boolean deleteBatch(List<Account> accounts){
		Connection conn = DataSourceManager.me().getMainConnection();
		return deleteBatch(accounts,conn);
	}
	
	public boolean deleteBatch(List<Account> accounts,Connection conn){
		return deleteBatch(accounts,conn,TABLE_NAME);
	}
	
	public boolean deleteBatch(List<Account> accounts,DataSource ds){
		try {
			Connection conn = ds.getConnection();
			return deleteBatch(accounts,conn);
		} catch (Exception e) {
			log.error(e);
			return false;
		}
	}
	
	public boolean deleteBatch(List<Account> accounts,String tableName){
		Connection conn = DataSourceManager.me().getMainConnection();
		return deleteBatch(accounts,conn,tableName);
	}
	
	public boolean deleteBatch(List<Account> accounts,Connection conn,String tableName){
		QueryRunner run = new QueryRunner();
		String sql = "DELETE FROM " + tableName + " WHERE id = ?";
		try {
			int size = accounts.size();
			Object[][] params = new Object[size][1];
			for (int i = 0; i < size; i++) {
				params[i][0] = accounts.get(i).getId();
			}
			int[] is = run.batch(conn,sql,params);
			return is.length > 0;
		} catch (Exception e) {
			log.error(e);
			return false;
		}finally {
			try{
				DbUtils.close(conn);
			}catch (Exception e1) {
				log.error(e1);
				return false;
			}
		}
	}
	
	public boolean deleteBatch(List<Account> accounts,DataSource ds,String tableName){
		try {
			Connection conn = ds.getConnection();
			return deleteBatch(accounts,conn,tableName);
		} catch (Exception e) {
			log.error(e);
			return false;
		}
	}

	/**
	 * 根据( id ) 查询
	 */
	public Account getById(String id){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getById(id, conn);
	}
	
	public Account getById(String id,String tableName){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getById(id, conn,tableName);
	}
	public List<Account> getIn(Set<String> ids){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getIn(ids, conn);
	}
	
	public List<Account> getIn(Set<String> ids,String tableName){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getIn(ids, conn,tableName);
	}
	/**
	 * 根据( account_id  channel_id ) 查询
	 */
	public Account getByAccountIdChannelId(String accountId, int channelId){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getByAccountIdChannelId(accountId,channelId, conn);
	}
	
	public Account getByAccountIdChannelId(String accountId, int channelId,String tableName){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getByAccountIdChannelId(accountId,channelId, conn,tableName);
	}
	/**
	 * 根据( channel_id ) 查询
	 */
	public List<Account> getByChannelId(int channelId){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getByChannelId(channelId, conn);
	}
	
	public List<Account> getByChannelId(int channelId,String tableName){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getByChannelId(channelId, conn,tableName);
	}
	
	public List<Account> getByPageChannelId(int channelId,int page,int pageSize){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getByPageChannelId(channelId, conn,page,pageSize);
	}
	
	public List<Account> getByPageChannelId(int channelId,String tableName,int page,int pageSize){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getByPageChannelId(channelId, conn,tableName,page,pageSize);
	}
	/**
	 * 根据( channel_app_id ) 查询
	 */
	public List<Account> getByChannelAppId(int channelAppId){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getByChannelAppId(channelAppId, conn);
	}
	
	public List<Account> getByChannelAppId(int channelAppId,String tableName){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getByChannelAppId(channelAppId, conn,tableName);
	}
	
	public List<Account> getByPageChannelAppId(int channelAppId,int page,int pageSize){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getByPageChannelAppId(channelAppId, conn,page,pageSize);
	}
	
	public List<Account> getByPageChannelAppId(int channelAppId,String tableName,int page,int pageSize){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getByPageChannelAppId(channelAppId, conn,tableName,page,pageSize);
	}
	/**
	 * 根据( game_server_id ) 查询
	 */
	public List<Account> getByGameServerId(String gameServerId){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getByGameServerId(gameServerId, conn);
	}
	
	public List<Account> getByGameServerId(String gameServerId,String tableName){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getByGameServerId(gameServerId, conn,tableName);
	}
	
	public List<Account> getByPageGameServerId(String gameServerId,int page,int pageSize){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getByPageGameServerId(gameServerId, conn,page,pageSize);
	}
	
	public List<Account> getByPageGameServerId(String gameServerId,String tableName,int page,int pageSize){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getByPageGameServerId(gameServerId, conn,tableName,page,pageSize);
	}
	
	//Connection
	/**
	 * 根据( id ) 查询
	 */
	public Account getById(String id,Connection conn){
		return getById(id,conn,TABLE_NAME);
	}
	
	public Account getById(String id,Connection conn,String tableName){
		QueryRunner run = new QueryRunner();
		String sql = "SELECT id,account_id,channel_id,channel_app_id,password,email,device_token,device_name,device_id,sdk,sdk_version,os_name,os_version,phone_number,client_version,question,answer,admin,game_server_id,language,ip,last_online_time,last_offline_time,state,online_state,activate,create_date,modified_date FROM " + tableName + " WHERE " + "id = ? ORDER BY id ASC LIMIT 1";
		Account account = null; 
		try {
			account = run.query(conn,sql, new AccountHandler(), id);
		} catch (Exception e) {
			log.error(e);
		}finally {
			try{
				DbUtils.close(conn);
			}catch (Exception e1) {
				log.error(e1);
				return null;
			}
		}
		return account;
	}
	public List<Account> getIn(Set<String> ids,Connection conn){
		return getIn(ids,conn,TABLE_NAME);
	}
	
	public List<Account> getIn(Set<String> ids,Connection conn,String tableName){
		List<Account> accounts = Lists.newArrayList();
		if(ids.isEmpty()) return accounts;
		QueryRunner run = new QueryRunner();
		String sql = "SELECT id,account_id,channel_id,channel_app_id,password,email,device_token,device_name,device_id,sdk,sdk_version,os_name,os_version,phone_number,client_version,question,answer,admin,game_server_id,language,ip,last_online_time,last_offline_time,state,online_state,activate,create_date,modified_date FROM " + tableName + " WHERE " + "id in (%s) ORDER BY id ASC";
		sql = String.format(sql, Joiner.on(",").join(ids));
		try {
			accounts = run.query(conn,sql, new AccountListHandler());
		} catch (Exception e) {
			log.error(e);
		}finally {
			try{
				DbUtils.close(conn);
			}catch (Exception e1) {
				log.error(e1);
				return null;
			}
		}
		return accounts;
	}
	/**
	 * 根据( account_id  channel_id ) 查询
	 */
	public Account getByAccountIdChannelId(String accountId, int channelId,Connection conn){
		return getByAccountIdChannelId(accountId,channelId,conn,TABLE_NAME);
	}
	
	public Account getByAccountIdChannelId(String accountId, int channelId,Connection conn,String tableName){
		QueryRunner run = new QueryRunner();
		String sql = "SELECT id,account_id,channel_id,channel_app_id,password,email,device_token,device_name,device_id,sdk,sdk_version,os_name,os_version,phone_number,client_version,question,answer,admin,game_server_id,language,ip,last_online_time,last_offline_time,state,online_state,activate,create_date,modified_date FROM " + tableName + " WHERE " + "account_id = ? AND channel_id = ? ORDER BY id ASC LIMIT 1";
		Account account = null; 
		try {
			account = run.query(conn,sql, new AccountHandler(), accountId,channelId);
		} catch (Exception e) {
			log.error(e);
		}finally {
			try{
				DbUtils.close(conn);
			}catch (Exception e1) {
				log.error(e1);
				return null;
			}
		}
		return account;
	}
	/**
	 * 根据( channel_id ) 查询
	 */
	public List<Account> getByChannelId(int channelId,Connection conn){
		return getByChannelId(channelId,conn,TABLE_NAME);
	}
	
	public List<Account> getByChannelId(int channelId,Connection conn,String tableName){
		QueryRunner run = new QueryRunner();
		String sql = "SELECT id,account_id,channel_id,channel_app_id,password,email,device_token,device_name,device_id,sdk,sdk_version,os_name,os_version,phone_number,client_version,question,answer,admin,game_server_id,language,ip,last_online_time,last_offline_time,state,online_state,activate,create_date,modified_date FROM " + tableName + " WHERE " + "channel_id = ? ORDER BY id ASC";
		List<Account> accounts = Lists.newArrayList();
		try {
			accounts = run.query(conn, sql, new AccountListHandler(), channelId);
		} catch (Exception e) {
			log.error(e);
		}finally {
			try{
				DbUtils.close(conn);
			}catch (Exception e1) {
				log.error(e1);
				return null;
			}
		}
		return accounts;
	}
	
	//-----------------------------------page-----------------------------------
	public List<Account> getByPageChannelId(int channelId,Connection conn,int page,int pageSize){
		return getByPageChannelId(channelId,conn,TABLE_NAME,page,pageSize);
	}
	
	public List<Account> getByPageChannelId(int channelId,Connection conn,String tableName,int page,int pageSize){
		QueryRunner run = new QueryRunner();
		page = ((page-1) * pageSize);
		String sql = "SELECT id,account_id,channel_id,channel_app_id,password,email,device_token,device_name,device_id,sdk,sdk_version,os_name,os_version,phone_number,client_version,question,answer,admin,game_server_id,language,ip,last_online_time,last_offline_time,state,online_state,activate,create_date,modified_date FROM " + tableName + " WHERE " + "channel_id = ? ORDER BY id ASC LIMIT " + page + " , " +pageSize;
		List<Account> accounts = Lists.newArrayList();
		try {
			accounts = run.query(conn, sql, new AccountListHandler(), channelId);
		} catch (Exception e) {
			log.error(e);
		}finally {
			try{
				DbUtils.close(conn);
			}catch (Exception e1) {
				log.error(e1);
				return null;
			}
		}
		return accounts;
	}
	/**
	 * 根据( channel_app_id ) 查询
	 */
	public List<Account> getByChannelAppId(int channelAppId,Connection conn){
		return getByChannelAppId(channelAppId,conn,TABLE_NAME);
	}
	
	public List<Account> getByChannelAppId(int channelAppId,Connection conn,String tableName){
		QueryRunner run = new QueryRunner();
		String sql = "SELECT id,account_id,channel_id,channel_app_id,password,email,device_token,device_name,device_id,sdk,sdk_version,os_name,os_version,phone_number,client_version,question,answer,admin,game_server_id,language,ip,last_online_time,last_offline_time,state,online_state,activate,create_date,modified_date FROM " + tableName + " WHERE " + "channel_app_id = ? ORDER BY id ASC";
		List<Account> accounts = Lists.newArrayList();
		try {
			accounts = run.query(conn, sql, new AccountListHandler(), channelAppId);
		} catch (Exception e) {
			log.error(e);
		}finally {
			try{
				DbUtils.close(conn);
			}catch (Exception e1) {
				log.error(e1);
				return null;
			}
		}
		return accounts;
	}
	
	//-----------------------------------page-----------------------------------
	public List<Account> getByPageChannelAppId(int channelAppId,Connection conn,int page,int pageSize){
		return getByPageChannelAppId(channelAppId,conn,TABLE_NAME,page,pageSize);
	}
	
	public List<Account> getByPageChannelAppId(int channelAppId,Connection conn,String tableName,int page,int pageSize){
		QueryRunner run = new QueryRunner();
		page = ((page-1) * pageSize);
		String sql = "SELECT id,account_id,channel_id,channel_app_id,password,email,device_token,device_name,device_id,sdk,sdk_version,os_name,os_version,phone_number,client_version,question,answer,admin,game_server_id,language,ip,last_online_time,last_offline_time,state,online_state,activate,create_date,modified_date FROM " + tableName + " WHERE " + "channel_app_id = ? ORDER BY id ASC LIMIT " + page + " , " +pageSize;
		List<Account> accounts = Lists.newArrayList();
		try {
			accounts = run.query(conn, sql, new AccountListHandler(), channelAppId);
		} catch (Exception e) {
			log.error(e);
		}finally {
			try{
				DbUtils.close(conn);
			}catch (Exception e1) {
				log.error(e1);
				return null;
			}
		}
		return accounts;
	}
	/**
	 * 根据( game_server_id ) 查询
	 */
	public List<Account> getByGameServerId(String gameServerId,Connection conn){
		return getByGameServerId(gameServerId,conn,TABLE_NAME);
	}
	
	public List<Account> getByGameServerId(String gameServerId,Connection conn,String tableName){
		QueryRunner run = new QueryRunner();
		String sql = "SELECT id,account_id,channel_id,channel_app_id,password,email,device_token,device_name,device_id,sdk,sdk_version,os_name,os_version,phone_number,client_version,question,answer,admin,game_server_id,language,ip,last_online_time,last_offline_time,state,online_state,activate,create_date,modified_date FROM " + tableName + " WHERE " + "game_server_id = ? ORDER BY id ASC";
		List<Account> accounts = Lists.newArrayList();
		try {
			accounts = run.query(conn, sql, new AccountListHandler(), gameServerId);
		} catch (Exception e) {
			log.error(e);
		}finally {
			try{
				DbUtils.close(conn);
			}catch (Exception e1) {
				log.error(e1);
				return null;
			}
		}
		return accounts;
	}
	
	//-----------------------------------page-----------------------------------
	public List<Account> getByPageGameServerId(String gameServerId,Connection conn,int page,int pageSize){
		return getByPageGameServerId(gameServerId,conn,TABLE_NAME,page,pageSize);
	}
	
	public List<Account> getByPageGameServerId(String gameServerId,Connection conn,String tableName,int page,int pageSize){
		QueryRunner run = new QueryRunner();
		page = ((page-1) * pageSize);
		String sql = "SELECT id,account_id,channel_id,channel_app_id,password,email,device_token,device_name,device_id,sdk,sdk_version,os_name,os_version,phone_number,client_version,question,answer,admin,game_server_id,language,ip,last_online_time,last_offline_time,state,online_state,activate,create_date,modified_date FROM " + tableName + " WHERE " + "game_server_id = ? ORDER BY id ASC LIMIT " + page + " , " +pageSize;
		List<Account> accounts = Lists.newArrayList();
		try {
			accounts = run.query(conn, sql, new AccountListHandler(), gameServerId);
		} catch (Exception e) {
			log.error(e);
		}finally {
			try{
				DbUtils.close(conn);
			}catch (Exception e1) {
				log.error(e1);
				return null;
			}
		}
		return accounts;
	}
	
	//DataSource
	/**
	 * 根据( id ) 查询
	 */
	public Account getById(String id,DataSource ds){
		try {
			Connection conn = ds.getConnection();
			return getById(id, conn);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	
	public Account getById(String id,DataSource ds,String tableName){
		try {
			Connection conn = ds.getConnection();
			return getById(id, conn, tableName);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	public List<Account> getIn(Set<String> ids,DataSource ds){
		try {
			Connection conn = ds.getConnection();
			return getIn(ids, conn);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	
	public List<Account> getIn(Set<String> ids,DataSource ds,String tableName){
		try {
			Connection conn = ds.getConnection();
			return getIn(ids, conn, tableName);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	/**
	 * 根据( account_id  channel_id ) 查询
	 */
	public Account getByAccountIdChannelId(String accountId, int channelId,DataSource ds){
		try {
			Connection conn = ds.getConnection();
			return getByAccountIdChannelId(accountId,channelId, conn);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	
	public Account getByAccountIdChannelId(String accountId, int channelId,DataSource ds,String tableName){
		try {
			Connection conn = ds.getConnection();
			return getByAccountIdChannelId(accountId,channelId, conn, tableName);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	/**
	 * 根据( channel_id ) 查询
	 */
	public List<Account> getByChannelId(int channelId,DataSource ds){
		try {
			Connection conn = ds.getConnection();
			return getByChannelId(channelId, conn);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	
	public List<Account> getByChannelId(int channelId,DataSource ds,String tableName){
		try {
			Connection conn = ds.getConnection();
			return getByChannelId(channelId, conn, tableName);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	//-----------------------------------page-----------------------------------
	public List<Account> getByPageChannelId(int channelId,DataSource ds,int page,int pageSize){
		try {
			Connection conn = ds.getConnection();
			return getByPageChannelId(channelId, conn,page,pageSize);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	
	public List<Account> getByPageChannelId(int channelId,DataSource ds,String tableName,int page,int pageSize){
		try {
			Connection conn = ds.getConnection();
			return getByPageChannelId(channelId, conn,page,pageSize);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	/**
	 * 根据( channel_app_id ) 查询
	 */
	public List<Account> getByChannelAppId(int channelAppId,DataSource ds){
		try {
			Connection conn = ds.getConnection();
			return getByChannelAppId(channelAppId, conn);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	
	public List<Account> getByChannelAppId(int channelAppId,DataSource ds,String tableName){
		try {
			Connection conn = ds.getConnection();
			return getByChannelAppId(channelAppId, conn, tableName);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	//-----------------------------------page-----------------------------------
	public List<Account> getByPageChannelAppId(int channelAppId,DataSource ds,int page,int pageSize){
		try {
			Connection conn = ds.getConnection();
			return getByPageChannelAppId(channelAppId, conn,page,pageSize);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	
	public List<Account> getByPageChannelAppId(int channelAppId,DataSource ds,String tableName,int page,int pageSize){
		try {
			Connection conn = ds.getConnection();
			return getByPageChannelAppId(channelAppId, conn,page,pageSize);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	/**
	 * 根据( game_server_id ) 查询
	 */
	public List<Account> getByGameServerId(String gameServerId,DataSource ds){
		try {
			Connection conn = ds.getConnection();
			return getByGameServerId(gameServerId, conn);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	
	public List<Account> getByGameServerId(String gameServerId,DataSource ds,String tableName){
		try {
			Connection conn = ds.getConnection();
			return getByGameServerId(gameServerId, conn, tableName);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	//-----------------------------------page-----------------------------------
	public List<Account> getByPageGameServerId(String gameServerId,DataSource ds,int page,int pageSize){
		try {
			Connection conn = ds.getConnection();
			return getByPageGameServerId(gameServerId, conn,page,pageSize);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	
	public List<Account> getByPageGameServerId(String gameServerId,DataSource ds,String tableName,int page,int pageSize){
		try {
			Connection conn = ds.getConnection();
			return getByPageGameServerId(gameServerId, conn,page,pageSize);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	
	
	public List<Account> getAll(){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getAll(conn);
	}
	
	public List<Account> getAll(Connection conn){
		return getAll(conn,TABLE_NAME);
	}
	
	public List<Account> getAll(DataSource ds){
		try {
			Connection conn = ds.getConnection();
			return getAll(conn);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	
	public List<Account> getAll(String tableName){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getAll(conn,tableName);
	}
	
	public List<Account> getAll(Connection conn,String tableName){
		QueryRunner run = new QueryRunner();
		String sql = "SELECT id,account_id,channel_id,channel_app_id,password,email,device_token,device_name,device_id,sdk,sdk_version,os_name,os_version,phone_number,client_version,question,answer,admin,game_server_id,language,ip,last_online_time,last_offline_time,state,online_state,activate,create_date,modified_date FROM " + tableName + " ORDER BY id ASC";
		List<Account> accounts = Lists.newArrayList();
		try {
			accounts = run.query(conn, sql, new AccountListHandler());
		} catch (Exception e) {
			log.error(e);
		}finally {
			try{
				DbUtils.close(conn);
			}catch (Exception e1) {
				log.error(e1);
				return null;
			}
		}
		return accounts;
	}
	
	public List<Account> getAll(DataSource ds,String tableName){
		try {
			Connection conn = ds.getConnection();
			return getAll(conn,tableName);
		} catch (Exception e) {
			log.error(e);
			return null;
		}		
	}
	
	public List<Account> getAllPage(int page,int pageSize){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getAllPage(conn,page,pageSize);
	}
	
	public List<Account> getAllPage(Connection conn,int page,int pageSize){
		return getAllPage(conn,TABLE_NAME,page,pageSize);
	}
	
	public List<Account> getAllPage(DataSource ds,int page,int pageSize){
		try {
			Connection conn = ds.getConnection();
			return getAllPage(conn,page,pageSize);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	
	public List<Account> getAllPage(String tableName,int page,int pageSize){
		Connection conn = DataSourceManager.me().getMainConnection();
		return getAllPage(conn,tableName,page,pageSize);
	}
	
	public List<Account> getAllPage(Connection conn,String tableName,int page,int pageSize){
		QueryRunner run = new QueryRunner();
		page = ((page-1) * pageSize);
		String sql = "SELECT id,account_id,channel_id,channel_app_id,password,email,device_token,device_name,device_id,sdk,sdk_version,os_name,os_version,phone_number,client_version,question,answer,admin,game_server_id,language,ip,last_online_time,last_offline_time,state,online_state,activate,create_date,modified_date FROM " + tableName + " ORDER BY id ASC LIMIT " + page + " , " +pageSize;
		List<Account> accounts = Lists.newArrayList();
		try {
			accounts = run.query(conn, sql, new AccountListHandler());
		} catch (Exception e) {
			log.error(e);
		}finally {
			try{
				DbUtils.close(conn);
			}catch (Exception e1) {
				log.error(e1);
				return null;
			}
		}
		return accounts;
	}
	
	public List<Account> getAllPage(DataSource ds,String tableName,int page,int pageSize){
		try {
			Connection conn = ds.getConnection();
			return getAllPage(conn,tableName,page,pageSize);
		} catch (Exception e) {
			log.error(e);
			return null;
		}		
	}
	
	public boolean truncate(){
		Connection conn = DataSourceManager.me().getMainConnection();
		return truncate(conn);
	}
	
	public boolean truncate(Connection conn){
		return truncate(conn,TABLE_NAME);
	}
	
	public boolean truncate(DataSource ds){
		try {
			Connection conn = ds.getConnection();
			return truncate(conn);
		} catch (Exception e) {
			log.error(e);
			return false;
		}
	}
	
	public boolean truncate(String tableName){
		Connection conn = DataSourceManager.me().getMainConnection();
		return truncate(conn,tableName);
	}
	
	public boolean truncate(Connection conn,String tableName){
		QueryRunner run = new QueryRunner();
		String sql = "TRUNCATE " + tableName;
		try {
			run.update(conn, sql);
			return true;
		} catch (Exception e) {
			log.error(e);
			return false;
		} finally {
			try {
				DbUtils.close(conn);
			} catch (Exception e1) {
				log.error(e1);
				return false;
			}
		}
	}
	
	public boolean truncate(DataSource ds,String tableName){
		try {
			Connection conn = ds.getConnection();
			return truncate(conn,tableName);
		} catch (Exception e) {
			log.error(e);
			return false;
		}
	}
	
	// 执行自定义查询sql
	public List<Map<String,Object>> executeQuerySql(String sql){
		Connection conn = DataSourceManager.me().getMainConnection();
		return executeQuerySql(conn,sql);
	}
	
	public List<Map<String,Object>> executeQuerySql(Connection conn,String sql){
		return executeQuerySql(conn,TABLE_NAME,sql);
	}
	
	public List<Map<String,Object>> executeQuerySql(DataSource ds,String sql){
		try {
			Connection conn = ds.getConnection();
			return executeQuerySql(conn,sql);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	
	public List<Map<String,Object>> executeQuerySql(String tableName,String sql){
		Connection conn = DataSourceManager.me().getMainConnection();
		return executeQuerySql(conn,tableName);
	}
	
	public List<Map<String,Object>> executeQuerySql(Connection conn,String tableName,String sql){
		QueryRunner run = new QueryRunner();
		ToolError.isAndTrue(ArtifactErrorCode.SQL_PERMISSIONS_ERROR, !StrUtil.startWithIgnoreCase(sql, "SELECT"));
		List<Map<String,Object>> list = Lists.newArrayList();
		try {
			list = run.query(conn,sql, new MapListHandler());
		} catch (Exception e) {
			log.error(e);
		}finally {
			try{
				DbUtils.close(conn);
			}catch (Exception e1) {
				log.error(e1);
				return null;
			}
		}
		return list;
	}
	/**
	public List<Map<String,Object>> executeQuerySql(DataSource ds,String tableName){
		try {
			Connection conn = ds.getConnection();
			return executeQuerySql(conn,tableName);
		} catch (Exception e) {
			log.error(e);
			return null;
		}
	}
	*/
	
	//
	
	//
	
	//Drop Table
	public boolean drop(){
		Connection conn = DataSourceManager.me().getMainConnection();
		return drop(conn);
	}
	
	public boolean drop(Connection conn){
		return drop(conn,TABLE_NAME);
	}
	
	public boolean drop(DataSource ds){
		try {
			Connection conn = ds.getConnection();
			return drop(conn);
		} catch (Exception e) {
			log.error(e);
			return false;
		}
	}
	
	public boolean drop(String tableName){
		Connection conn = DataSourceManager.me().getMainConnection();
		return drop(conn,tableName);
	}
	
	public boolean drop(Connection conn,String tableName){
		QueryRunner run = new QueryRunner();
		String sql = "DROP TABLE " + tableName;
		try {
			run.update(conn, sql);
			return true;
		} catch (Exception e) {
			log.error(e);
			return false;
		} finally {
			try {
				DbUtils.close(conn);
			} catch (Exception e1) {
				log.error(e1);
				return false;
			}
		}
	}
	
	public boolean drop(DataSource ds,String tableName){
		try {
			Connection conn = ds.getConnection();
			return drop(conn,tableName);
		} catch (Exception e) {
			log.error(e);
			return false;
		}
	}
	
	
	//create
	public boolean createTable(CreateTableEnum type){
		Connection conn = DataSourceManager.me().getMainConnection();
		return createTable(conn,type);
	}
	
	public boolean createTable(Connection conn,CreateTableEnum type){
		return createTable(conn,TABLE_NAME,type);
	}
	
	public boolean createTable(DataSource ds,CreateTableEnum type){
		try {
			Connection conn = ds.getConnection();
			return createTable(conn,type);
		} catch (Exception e) {
			log.error(e);
			return false;
		}
	}
	
	public boolean createTable(String tableName,CreateTableEnum type){
		Connection conn = DataSourceManager.me().getMainConnection();
		return createTable(conn,tableName,type);
	}
	
	public boolean createTable(Connection conn,String tableName,CreateTableEnum type){
		QueryRunner run = new QueryRunner();
		SK_Plus plus = SK_Plus.b("CREATE TABLE IF NOT EXISTS `", tableName,"` (");
		plus.a("  `id` VARCHAR(45) NOT NULL  COMMENT 'remarks=id',");	
		plus.a("  `account_id` VARCHAR(45) NOT NULL  COMMENT 'remarks=平台账号id',");	
		plus.a("  `channel_id` INT(11) NOT NULL  COMMENT 'remarks=渠道ID',");	
		plus.a("  `channel_app_id` INT(11) NOT NULL  COMMENT 'remarks=渠道APPID',");	
		plus.a("  `password` VARCHAR(64)   COMMENT 'remarks=密码（是MD5加密后的）',");	
		plus.a("  `email` VARCHAR(64)   COMMENT 'remarks=用户手动绑定的邮箱',");	
		plus.a("  `device_token` VARCHAR(45)   COMMENT 'remarks=设备token',");	
		plus.a("  `device_name` VARCHAR(45)   COMMENT 'remarks=设备名称',");	
		plus.a("  `device_id` VARCHAR(45)   COMMENT 'remarks=设备唯一ID',");	
		plus.a("  `sdk` VARCHAR(45)   COMMENT 'remarks=SDK类型',");	
		plus.a("  `sdk_version` VARCHAR(45)   COMMENT 'remarks=SDK版本',");	
		plus.a("  `os_name` VARCHAR(45)   COMMENT 'remarks=系统名称',");	
		plus.a("  `os_version` VARCHAR(45)   COMMENT 'remarks=系统版本',");	
		plus.a("  `phone_number` VARCHAR(50)   COMMENT 'remarks=手机号（限定唯一并且填充时进行唯一检测）',");	
		plus.a("  `client_version` VARCHAR(45)   COMMENT 'remarks=客户端版本号',");	
		plus.a("  `question` VARCHAR(32)   COMMENT 'remarks=密保问题',");	
		plus.a("  `answer` VARCHAR(64)   COMMENT 'remarks=密保答案',");	
		plus.a("  `admin` TINYINT(1)   COMMENT 'remarks=管理员账号',");	
		plus.a("  `game_server_id` VARCHAR(20)   COMMENT 'remarks=游戏服id',");	
		plus.a("  `language` VARCHAR(45)   COMMENT 'remarks=语言',");	
		plus.a("  `ip` VARCHAR(45)   COMMENT 'remarks=ip地址',");	
		plus.a("  `last_online_time` DATETIME   COMMENT 'remarks=最后上线时间',");
		plus.a("  `last_offline_time` DATETIME   COMMENT 'remarks=最后下线时间',");
		plus.a("  `state` INT(11)   COMMENT 'remarks=封禁状态（账号冻结、禁言等）',");	
		plus.a("  `online_state` INT(11)   COMMENT 'remarks=在线状态',");	
		plus.a("  `activate` TINYINT(1)   COMMENT 'remarks=是否激活',");	
		plus.a("  `create_date` DATETIME NOT NULL  COMMENT 'remarks=创建时间',");
		plus.a("  `modified_date` DATETIME NOT NULL  COMMENT 'remarks=修改时间',");
		plus.a("  PRIMARY KEY (`id`),");
		if (CreateTableEnum.LOGIC.equals(type) || CreateTableEnum.DESIGN.equals(type)) {
			plus.a("  UNIQUE KEY `index4` (`account_id`,`channel_id`),");
			plus.a("  KEY `fk_account_channel1_idx` (`channel_id`),");
			plus.a("  KEY `fk_account_channel_app1_idx` (`channel_app_id`),");
			plus.a("  KEY `fk_account_game_server1_idx` (`game_server_id`),");
			
		}
		if (CreateTableEnum.DESIGN.equals(type)) {
			plus.a("  CONSTRAINT `fk_account_channel1` FOREIGN KEY (`channel_id`) REFERENCES `channel` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,");
			plus.a("  CONSTRAINT `fk_account_channel_app1` FOREIGN KEY (`channel_app_id`) REFERENCES `channel_app` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,");
		}
		String sql = plus.e();
		sql = StrUtil.subPre(sql, sql.lastIndexOf(StrUtil.C_COMMA));
		sql+=") ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='remarks=账号表';";
		try {
			run.update(conn, sql);
			return true;
		} catch (Exception e) {
			log.error(e);
			return false;
		} finally {
			try {
				DbUtils.close(conn);
			} catch (Exception e1) {
				log.error(e1);
				return false;
			}
		}
	}
	
	public boolean createTable(DataSource ds,String tableName,CreateTableEnum type){
		try {
			Connection conn = ds.getConnection();
			return createTable(conn,tableName,type);
		} catch (Exception e) {
			log.error(e);
			return false;
		}
	}
	
	
	public String getTableName(){
		return TABLE_NAME;
	}
	
	@SuppressWarnings("unchecked")
	public List<Map<String,Object>> getColumnsInfo(){
		SK_Plus sp = SK_Plus.newSK_Plus();
		sp.a("[");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"NO\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"id\",\"NULLABLE\":0,\"REMARKS\":\"remarks=id\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":135,\"ORDINAL_POSITION\":1,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":12,\"TYPE_NAME\":\"VARCHAR\",\"COLUMN_SIZE\":45}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"NO\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"account_id\",\"NULLABLE\":0,\"REMARKS\":\"remarks=平台账号id\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":135,\"ORDINAL_POSITION\":2,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":12,\"TYPE_NAME\":\"VARCHAR\",\"COLUMN_SIZE\":45}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"NO\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"channel_id\",\"NULLABLE\":0,\"REMARKS\":\"remarks=渠道ID\",\"DECIMAL_DIGITS\":0,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":null,\"ORDINAL_POSITION\":3,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":4,\"TYPE_NAME\":\"INT\",\"COLUMN_SIZE\":11}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"NO\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"channel_app_id\",\"NULLABLE\":0,\"REMARKS\":\"remarks=渠道APPID\",\"DECIMAL_DIGITS\":0,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":null,\"ORDINAL_POSITION\":4,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":4,\"TYPE_NAME\":\"INT\",\"COLUMN_SIZE\":11}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"password\",\"NULLABLE\":1,\"REMARKS\":\"remarks=密码（是MD5加密后的）\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":192,\"ORDINAL_POSITION\":5,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":12,\"TYPE_NAME\":\"VARCHAR\",\"COLUMN_SIZE\":64}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"email\",\"NULLABLE\":1,\"REMARKS\":\"remarks=用户手动绑定的邮箱\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":192,\"ORDINAL_POSITION\":6,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":12,\"TYPE_NAME\":\"VARCHAR\",\"COLUMN_SIZE\":64}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"device_token\",\"NULLABLE\":1,\"REMARKS\":\"remarks=设备token\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":135,\"ORDINAL_POSITION\":7,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":12,\"TYPE_NAME\":\"VARCHAR\",\"COLUMN_SIZE\":45}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"device_name\",\"NULLABLE\":1,\"REMARKS\":\"remarks=设备名称\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":135,\"ORDINAL_POSITION\":8,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":12,\"TYPE_NAME\":\"VARCHAR\",\"COLUMN_SIZE\":45}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"device_id\",\"NULLABLE\":1,\"REMARKS\":\"remarks=设备唯一ID\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":135,\"ORDINAL_POSITION\":9,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":12,\"TYPE_NAME\":\"VARCHAR\",\"COLUMN_SIZE\":45}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"sdk\",\"NULLABLE\":1,\"REMARKS\":\"remarks=SDK类型\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":135,\"ORDINAL_POSITION\":10,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":12,\"TYPE_NAME\":\"VARCHAR\",\"COLUMN_SIZE\":45}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"sdk_version\",\"NULLABLE\":1,\"REMARKS\":\"remarks=SDK版本\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":135,\"ORDINAL_POSITION\":11,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":12,\"TYPE_NAME\":\"VARCHAR\",\"COLUMN_SIZE\":45}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"os_name\",\"NULLABLE\":1,\"REMARKS\":\"remarks=系统名称\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":135,\"ORDINAL_POSITION\":12,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":12,\"TYPE_NAME\":\"VARCHAR\",\"COLUMN_SIZE\":45}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"os_version\",\"NULLABLE\":1,\"REMARKS\":\"remarks=系统版本\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":135,\"ORDINAL_POSITION\":13,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":12,\"TYPE_NAME\":\"VARCHAR\",\"COLUMN_SIZE\":45}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"phone_number\",\"NULLABLE\":1,\"REMARKS\":\"remarks=手机号（限定唯一并且填充时进行唯一检测）\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":150,\"ORDINAL_POSITION\":14,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":12,\"TYPE_NAME\":\"VARCHAR\",\"COLUMN_SIZE\":50}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"client_version\",\"NULLABLE\":1,\"REMARKS\":\"remarks=客户端版本号\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":135,\"ORDINAL_POSITION\":15,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":12,\"TYPE_NAME\":\"VARCHAR\",\"COLUMN_SIZE\":45}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"question\",\"NULLABLE\":1,\"REMARKS\":\"remarks=密保问题\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":96,\"ORDINAL_POSITION\":16,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":12,\"TYPE_NAME\":\"VARCHAR\",\"COLUMN_SIZE\":32}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"answer\",\"NULLABLE\":1,\"REMARKS\":\"remarks=密保答案\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":192,\"ORDINAL_POSITION\":17,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":12,\"TYPE_NAME\":\"VARCHAR\",\"COLUMN_SIZE\":64}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"admin\",\"NULLABLE\":1,\"REMARKS\":\"remarks=管理员账号\",\"DECIMAL_DIGITS\":0,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":null,\"ORDINAL_POSITION\":18,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":-6,\"TYPE_NAME\":\"TINYINT\",\"COLUMN_SIZE\":1}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"game_server_id\",\"NULLABLE\":1,\"REMARKS\":\"remarks=游戏服id\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":60,\"ORDINAL_POSITION\":19,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":12,\"TYPE_NAME\":\"VARCHAR\",\"COLUMN_SIZE\":20}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"language\",\"NULLABLE\":1,\"REMARKS\":\"remarks=语言\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":135,\"ORDINAL_POSITION\":20,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":12,\"TYPE_NAME\":\"VARCHAR\",\"COLUMN_SIZE\":45}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"ip\",\"NULLABLE\":1,\"REMARKS\":\"remarks=ip地址\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":135,\"ORDINAL_POSITION\":21,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":12,\"TYPE_NAME\":\"VARCHAR\",\"COLUMN_SIZE\":45}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"last_online_time\",\"NULLABLE\":1,\"REMARKS\":\"remarks=最后上线时间\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":null,\"ORDINAL_POSITION\":22,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":93,\"TYPE_NAME\":\"DATETIME\",\"COLUMN_SIZE\":19}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"last_offline_time\",\"NULLABLE\":1,\"REMARKS\":\"remarks=最后下线时间\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":null,\"ORDINAL_POSITION\":23,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":93,\"TYPE_NAME\":\"DATETIME\",\"COLUMN_SIZE\":19}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"state\",\"NULLABLE\":1,\"REMARKS\":\"remarks=封禁状态（账号冻结、禁言等）\",\"DECIMAL_DIGITS\":0,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":null,\"ORDINAL_POSITION\":24,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":4,\"TYPE_NAME\":\"INT\",\"COLUMN_SIZE\":11}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"online_state\",\"NULLABLE\":1,\"REMARKS\":\"remarks=在线状态\",\"DECIMAL_DIGITS\":0,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":null,\"ORDINAL_POSITION\":25,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":4,\"TYPE_NAME\":\"INT\",\"COLUMN_SIZE\":11}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"YES\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"activate\",\"NULLABLE\":1,\"REMARKS\":\"remarks=是否激活\",\"DECIMAL_DIGITS\":0,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":null,\"ORDINAL_POSITION\":26,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":-6,\"TYPE_NAME\":\"TINYINT\",\"COLUMN_SIZE\":1}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"NO\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"create_date\",\"NULLABLE\":0,\"REMARKS\":\"remarks=创建时间\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":null,\"ORDINAL_POSITION\":27,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":93,\"TYPE_NAME\":\"DATETIME\",\"COLUMN_SIZE\":19}").a(",");
       	sp.a("{\"SCOPE_TABLE\":null,\"TABLE_CAT\":\"dal_login_design\",\"BUFFER_LENGTH\":65535,\"IS_NULLABLE\":\"NO\",\"TABLE_NAME\":\"account\",\"COLUMN_DEF\":null,\"SCOPE_CATALOG\":null,\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"modified_date\",\"NULLABLE\":0,\"REMARKS\":\"remarks=修改时间\",\"DECIMAL_DIGITS\":null,\"NUM_PREC_RADIX\":10,\"SQL_DATETIME_SUB\":0,\"IS_GENERATEDCOLUMN\":\"NO\",\"IS_AUTOINCREMENT\":\"NO\",\"SQL_DATA_TYPE\":0,\"CHAR_OCTET_LENGTH\":null,\"ORDINAL_POSITION\":28,\"SCOPE_SCHEMA\":null,\"SOURCE_DATA_TYPE\":null,\"DATA_TYPE\":93,\"TYPE_NAME\":\"DATETIME\",\"COLUMN_SIZE\":19}").a(",");
        sp.a("]");
        return JsonManager.me().getJson().parse(sp.e(), List.class);
	}
	
	@SuppressWarnings("unchecked")
	public List<Map<String,Object>> getIndexsInfo(){
		SK_Plus sp = SK_Plus.newSK_Plus();
		sp.a("[");
       	sp.a("{\"NON_UNIQUE\":false,\"TABLE_CAT\":\"dal_login_design\",\"PAGES\":null,\"TABLE_NAME\":\"account\",\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"id\",\"INDEX_NAME\":\"PRIMARY\",\"ASC_OR_DESC\":\"A\",\"INDEX_QUALIFIER\":\"dal_login_design\",\"ORDINAL_POSITION\":1,\"CARDINALITY\":0,\"FILTER_CONDITION\":null,\"TYPE\":3}").a(",");
       	sp.a("{\"NON_UNIQUE\":false,\"TABLE_CAT\":\"dal_login_design\",\"PAGES\":null,\"TABLE_NAME\":\"account\",\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"account_id\",\"INDEX_NAME\":\"index4\",\"ASC_OR_DESC\":\"A\",\"INDEX_QUALIFIER\":\"dal_login_design\",\"ORDINAL_POSITION\":1,\"CARDINALITY\":0,\"FILTER_CONDITION\":null,\"TYPE\":3}").a(",");
       	sp.a("{\"NON_UNIQUE\":false,\"TABLE_CAT\":\"dal_login_design\",\"PAGES\":null,\"TABLE_NAME\":\"account\",\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"channel_id\",\"INDEX_NAME\":\"index4\",\"ASC_OR_DESC\":\"A\",\"INDEX_QUALIFIER\":\"dal_login_design\",\"ORDINAL_POSITION\":2,\"CARDINALITY\":0,\"FILTER_CONDITION\":null,\"TYPE\":3}").a(",");
       	sp.a("{\"NON_UNIQUE\":true,\"TABLE_CAT\":\"dal_login_design\",\"PAGES\":null,\"TABLE_NAME\":\"account\",\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"channel_id\",\"INDEX_NAME\":\"fk_account_channel1_idx\",\"ASC_OR_DESC\":\"A\",\"INDEX_QUALIFIER\":\"dal_login_design\",\"ORDINAL_POSITION\":1,\"CARDINALITY\":0,\"FILTER_CONDITION\":null,\"TYPE\":3}").a(",");
       	sp.a("{\"NON_UNIQUE\":true,\"TABLE_CAT\":\"dal_login_design\",\"PAGES\":null,\"TABLE_NAME\":\"account\",\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"channel_app_id\",\"INDEX_NAME\":\"fk_account_channel_app1_idx\",\"ASC_OR_DESC\":\"A\",\"INDEX_QUALIFIER\":\"dal_login_design\",\"ORDINAL_POSITION\":1,\"CARDINALITY\":0,\"FILTER_CONDITION\":null,\"TYPE\":3}").a(",");
       	sp.a("{\"NON_UNIQUE\":true,\"TABLE_CAT\":\"dal_login_design\",\"PAGES\":null,\"TABLE_NAME\":\"account\",\"TABLE_SCHEM\":null,\"COLUMN_NAME\":\"game_server_id\",\"INDEX_NAME\":\"fk_account_game_server1_idx\",\"ASC_OR_DESC\":\"A\",\"INDEX_QUALIFIER\":\"dal_login_design\",\"ORDINAL_POSITION\":1,\"CARDINALITY\":0,\"FILTER_CONDITION\":null,\"TYPE\":3}").a(",");
        sp.a("]");
        return JsonManager.me().getJson().parse(sp.e(), List.class);
	}
//自定义内容起始位置
class AccountHandler implements ResultSetHandler<Account>{
	@Override
	public Account handle(ResultSet rs) throws SQLException {
		return rs.next() ? Account.builder().createForResultSet(rs).syncIndexValues() : null ;
	}
}

class AccountListHandler extends AbstractListHandler<Account>{
	@Override
	protected Account handleRow(ResultSet rs) throws SQLException {
		return Account.builder().createForResultSet(rs).syncIndexValues();
	}
}

//自定义内容结束位置
}

